home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / demo / medmfc.zip / MAGMAED.HPP < prev    next >
C/C++ Source or Header  |  1994-06-24  |  5KB  |  177 lines

  1. #define _AFXWIN_INLINE  inline
  2.  
  3. //
  4. // Include the MAGMAED header file. Has a list of messages & structures
  5. //
  6. #include "magmaed.h"
  7. #include "magmaid.h"
  8.  
  9. ////////////////////////////////////////////////////////////////////
  10. // CMagmaEdit
  11. //
  12. // This header was taken from the CEdit declaration in mfc\include\afxwin.h
  13. //
  14. ////////////////////////////////////////////////////////////////////
  15. class CMagmaEdit : public CEdit
  16. {
  17.   DECLARE_DYNAMIC(CMagmaEdit)
  18.  
  19. // Constructors
  20. public:
  21.   CMagmaEdit();
  22.   BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID);
  23.   BOOL GetStatus(MAGMAED_STATUS &meStatus)
  24.   {
  25.     return (BOOL) SendMessage(ME_QUERYSTATUS, 0, 
  26.                               (LONG) (LPMAGMAED_STATUS) &meStatus);
  27.   }
  28.  
  29. // Implementation
  30. public:
  31.   virtual ~CMagmaEdit();
  32.  
  33. // Misc
  34.   int GetLastSearchPattern(LPSTR lpBuf = NULL);
  35.  
  36. protected:
  37.   virtual WNDPROC* GetSuperWndProcAddr();
  38. };
  39.  
  40.  
  41. /////////////////////////////////////////////////////////////////////////////
  42. //
  43. // CMagmaEditView
  44. //
  45. //   Class declaration taken from mfc\include\afxext.h
  46. //
  47. //
  48. /////////////////////////////////////////////////////////////////////////////
  49.  
  50. class CMagmaEditView : public CView
  51. {
  52.   DECLARE_DYNCREATE(CMagmaEditView)
  53.  
  54. // Construction
  55. public:
  56.   CMagmaEditView();
  57.   static const DWORD dwStyleDefault;
  58.  
  59. // Attributes
  60. public:
  61.   // CEdit control access
  62.   _AFXWIN_INLINE CMagmaEdit& GetEditCtrl() const;
  63.  
  64.   // presentation attributes
  65.   CFont* GetPrinterFont() const;
  66.   void SetPrinterFont(CFont* pFont);
  67.   void SetTabStops(int nTabStops);
  68.  
  69.   // other attributes
  70.  
  71. // Operations
  72. public:
  73.   UINT  PrintInsideRect(CDC* pDC, RECT& rectLayout, UINT nIndexStart,
  74.                        UINT nIndexStop);
  75.   void SerializeRaw(CArchive& ar);
  76.  
  77. // Overrideables
  78. protected:
  79.   virtual void OnFindNext(LPCSTR lpszFind, BOOL bNext, BOOL bCase);
  80.   virtual void OnReplaceSel(LPCSTR lpszFind, BOOL bNext, BOOL bCase,
  81.                             LPCSTR lpszReplace);
  82.   virtual void OnReplaceAll(LPCSTR lpszFind, LPCSTR lpszReplace,
  83.                             BOOL bCase);
  84.   virtual void OnTextNotFound(LPCSTR lpszFind = NULL);
  85.  
  86.  
  87. // Implementation
  88. public:
  89.     virtual ~CMagmaEditView();
  90. #ifdef _DEBUG
  91.     virtual void AssertValid() const;
  92.     virtual void Dump(CDumpContext& dc) const;
  93. #endif
  94.     virtual void OnDraw(CDC* pDC);
  95.     virtual void Serialize(CArchive& ar);
  96.     virtual void DeleteContents();
  97.     void ReadFromArchive(CArchive& ar, DWORD nLen);
  98.     void WriteToArchive(CArchive& ar);
  99.     virtual void OnPrepareDC(CDC* pDC, CPrintInfo* pInfo);
  100.  
  101.         MAGMAED_STATUS &GetStatus()
  102.         {
  103.           MAGMAED_STATUS meStatus;
  104.           GetEditCtrl().GetStatus(meStatus);
  105.           return meStatus;
  106.         }
  107.  
  108.  
  109.     static const DWORD nMaxSize; // maximum number of characters supported
  110.  
  111.  
  112. protected:
  113.     int m_nTabStops;            // tab stops in dialog units
  114.  
  115.     CUIntArray m_aPageStart;    // array of starting pages
  116.     HFONT m_hPrinterFont;       // if NULL, mirror display font
  117.     HFONT m_hMirrorFont;        // font object used when mirroring
  118.  
  119.     // construction
  120.     WNDPROC* GetSuperWndProcAddr();
  121.     virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  122.  
  123.     // printing support
  124.     virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
  125.     virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
  126.     virtual void OnPrint(CDC* pDC, CPrintInfo* pInfo);
  127.     virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo = NULL);
  128.     BOOL PaginateTo(CDC* pDC, CPrintInfo* pInfo);
  129.  
  130.     // find & replace support
  131.     void OnEditFindReplace(BOOL bFindOnly);
  132.  
  133.     // buffer access
  134.     DWORD GetBufferLength() const;
  135.  
  136.     // special overrides for implementation
  137.     virtual void CalcWindowRect(LPRECT lpClientRect,
  138.         UINT nAdjustType = adjustBorder);
  139.  
  140.     //{{AFX_MSG(CMagmaEditView)
  141.     afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  142.     afx_msg void OnPaint();
  143.     afx_msg LRESULT OnSetFont(WPARAM wParam, LPARAM lParam);
  144.     afx_msg void OnUpdateNeedSel(CCmdUI* pCmdUI);
  145.     afx_msg void OnUpdateNeedClip(CCmdUI* pCmdUI);
  146.     afx_msg void OnUpdateNeedText(CCmdUI* pCmdUI);
  147.     afx_msg void OnUpdateNeedFind(CCmdUI* pCmdUI);
  148.     afx_msg void OnUpdateEditUndo(CCmdUI* pCmdUI);
  149.     afx_msg void OnEditChange();
  150.     afx_msg void OnEditCut();
  151.     afx_msg void OnEditCopy();
  152.     afx_msg void OnEditPaste();
  153.     afx_msg void OnEditClear();
  154.     afx_msg void OnEditUndo();
  155.     afx_msg void OnEditSelectAll();
  156.     afx_msg void OnEditFind();
  157.     afx_msg void OnEditReplace();
  158.     afx_msg void OnEditRepeat();
  159.     afx_msg LRESULT OnFindReplaceCmd(WPARAM wParam, LPARAM lParam);
  160.  
  161.     // MagmaEd extensions
  162.     afx_msg void OnEditMarkLine();
  163.     afx_msg void OnEditMarkLineRange();
  164.     afx_msg void OnEditMarkStream();
  165.     afx_msg void OnEditMarkRect();
  166.     afx_msg void OnEditMarkReset();
  167.  
  168.     //}}AFX_MSG
  169.  
  170.     DECLARE_MESSAGE_MAP()
  171. };
  172.  
  173. _AFXWIN_INLINE CMagmaEdit& CMagmaEditView::GetEditCtrl() const
  174.     { return * (CMagmaEdit*) this; }
  175.  
  176.  
  177.